package com.itheima.mapper;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    @Select("select * from User")
    List<User> findAll();

    @Insert("insert into User values(id,#{age},#{username},#{password},#{email},#{sex})")
    void save(User user);


    void deleteByIds(Integer[] idsArray);

    @Update("update User set age=#{age},username=#{username},password=#{password},email=#{email},sex=#{sex} where id=#{id} ")
    void update(User user);
}
